
<%@ page import="coe.pumbaa.Role" %>

<html>
  <head>
    <meta name="layout" content="PumbaaLayout">
  <g:set var="entityName" value="${message(code: 'role.label', default: 'Role')}" />
  <title>Role Manager</title>
</head>
<body>
  <section id="main" class="column">
    <pumbaa:alert />
    <article class="module width_full">
      <header><h3>Role</h3></header>
      <table class="tablesorter" cellspacing="0">
        <thead> 
          <tr>  
            <th>Type</th> 
            <th>Level</th> 
            <th style="width: 10%;">Actions</th> 
          </tr> 
        </thead>
        <tbody>
          <g:each in="${roleInstanceList.sort{it.level}}" var="roleInstance">
            <tr>
              
              <td>${fieldValue(bean: roleInstance, field: "type")}</td>

              <td>${fieldValue(bean: roleInstance, field: "level")}</td>
              
              <td>
                <g:link action="edit" id="${roleInstance.id}"><input type="image" src="${resource(dir: 'images', file: 'icn_edit.png')}" title="Edit"></g:link>
                <g:link action="delete" id="${roleInstance.id}"><input type="image" src="${resource(dir: 'images', file: 'icn_trash.png')}" title="Trash" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"></g:link>
              </td>

            </tr>
          </g:each>
        </tbody>
      </table>
      <footer>
        <div class="pagination">
        <h4><g:paginate total="${roleInstanceTotal}" /></h4>
      </div>
      </footer>
    </article>
      
    
    <article class="module width_full">
      <header><h3>Create new role</h3></header>
      <g:form method="POST" action="save">
        <div class="module_content">
        <g:render template="form"/>
        <div class="submit_link">
          <g:submitButton class="alt_btn" name="submit" value="Create"/>
        </div>
        </div>
        <div class="clear"></div>
     </g:form>
    </article>
    <div class="spacer"></div>
  </section>
</body>
</html>
